//递增子序列: https://www.nowcoder.com/exam/test/90994097/detail?pid=18874168
#include<iostream>
#include<vector>
#include<climits>
using namespace std;
int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    int first = a[0], second = INT_MAX;
    for (int i = 1; i < n; i++) 
    {
        if (a[i] < first) 
        {
            first = a[i];
            //如果更新了最小值，则第二小的值需要在后面找，所以此处需要更新
            second = INT_MAX;
        } else if (a[i] > first && a[i] < second)
        {
            second = a[i];
        }
        else if (a[i] > first && a[i] > second) 
        {
            cout << "true" << endl;
            return 0;
        }
    }
    cout << "false" << endl;
    return 0;
}